package com.goodving.guli.bt.model;

import android.text.TextUtils;

import com.goodving.guli.bt.dataprocess.StepsInfo;
import com.goodving.guli.bt.profile.scale.GuliLog;
import com.goodving.guli.view.C3657a;

import org.json.JSONException;
import org.json.JSONObject;

/**
 * Created by john on 2015/12/7.
 */
public class C1634i {
    private static final String f8203j = "rn";
    private static final String f8204k = "wk";
    private static final String f8205l = "cal";
    private static final String f8206m = "rdis";
    private static final String f8207n = "rcal";
    private static final String f8208o = "dis";
    private static final String f8209p = "ttl";
    private static final String f8210q = "rttl";
    private static final String f8211r = "v";
    private static final String f8212s = "rfttl";
    private static final String f8213t = "goal";
    private int f8214a;
    private int f8215b;
    private int f8216c;
    private int f8217d;
    private int f8218e;
    private int f8219f;
    private int f8220g;
    private int f8221h;
    private int f8222i;
    private int f8223u;
    private int f8224v;
    private String f8225w;

    public C1634i() {
        this.f8214a = 0;
        this.f8215b = 0;
        this.f8216c = 0;
        this.f8217d = 0;
        this.f8218e = 0;
        this.f8219f = 0;
        this.f8220g = 0;
        this.f8221h = 0;
        this.f8222i = 1;
        this.f8223u = 0;
        this.f8224v = 0;
        this.f8225w = C3657a.f18328f;
//        this.f8225w = C1574c.m12609h();
//        this.f8224v = C1574c.m12606e();
    }

    public JSONObject m12954a() {
        JSONObject jSONObject = new JSONObject();
        try {
            jSONObject.put(f8213t, this.f8224v);
            jSONObject.put(f8211r, this.f8222i);
            JSONObject jSONObject2 = new JSONObject();
            jSONObject2.put(f8203j, this.f8220g);
            jSONObject2.put(f8204k, this.f8221h);
            jSONObject2.put(f8205l, this.f8214a);
            jSONObject2.put(f8207n, this.f8215b);
            jSONObject2.put(f8206m, this.f8218e);
            jSONObject2.put(f8208o, this.f8219f);
            jSONObject2.put(f8209p, this.f8217d);
            jSONObject2.put(f8210q, this.f8216c);
            jSONObject2.put(f8212s, this.f8223u);
            jSONObject.put(StepsInfo.KEY_STEP_INFO, jSONObject2);
        } catch (JSONException e) {
            GuliLog.tracePrintInfo("SDM", e.getMessage());
        }
        return jSONObject;
    }

    public void m12955a(int i) {
        this.f8214a = i;
    }

    public boolean m12956a(String str) {
        if (TextUtils.isEmpty(str)) {
            return false;
        }
        try {
            JSONObject jSONObject = new JSONObject(str);
            this.f8222i = jSONObject.optInt(f8211r);
            this.f8224v = jSONObject.optInt(f8213t);
            jSONObject = jSONObject.optJSONObject(StepsInfo.KEY_STEP_INFO);
            if (jSONObject == null) {
                return false;
            }
            this.f8220g = jSONObject.optInt(f8203j);
            this.f8221h = jSONObject.optInt(f8204k);
            this.f8214a = jSONObject.optInt(f8205l);
            this.f8215b = jSONObject.optInt(f8207n);
            this.f8219f = jSONObject.optInt(f8208o);
            this.f8217d = jSONObject.optInt(f8209p);
            this.f8216c = jSONObject.optInt(f8210q);
            this.f8223u = jSONObject.optInt(f8212s);
            this.f8218e = jSONObject.optInt(f8206m);
            return true;
        } catch (JSONException e) {
            GuliLog.tracePrintError("SDM", e.getMessage());
            return false;
        }
    }

    public int m12957b() {
        return this.f8214a;
    }

    public void m12958b(int i) {
        this.f8219f = i;
    }

    public int m12959c() {
        return this.f8219f;
    }

    public void m12960c(int i) {
        this.f8223u = i;
    }

    public int m12961d() {
        return this.f8223u;
    }

    public void m12962d(int i) {
        this.f8224v = i;
    }

    public int m12963e() {
        return this.f8224v;
    }

    public void m12964e(int i) {
        this.f8215b = i;
    }

    public int m12965f() {
        return this.f8215b;
    }

    public void m12966f(int i) {
        this.f8218e = i;
    }

    public int m12967g() {
        return this.f8218e;
    }

    public void m12968g(int i) {
        this.f8216c = i;
    }

    public int m12969h() {
        return this.f8216c;
    }

    public void m12970h(int i) {
        this.f8220g = i;
    }

    public int m12971i() {
        return this.f8220g;
    }

    public void m12972i(int i) {
        this.f8217d = i;
    }

    public int m12973j() {
        return this.f8214a - this.f8215b;
    }

    public void m12974j(int i) {
        this.f8221h = i;
    }

    public int m12975k() {
        return this.f8219f - this.f8218e;
    }

    public int m12976l() {
        return this.f8217d;
    }

    public String m12977m() {
        return m12954a().toString();
    }

    public int m12978n() {
        return this.f8221h + this.f8220g;
    }

    public String m12979o() {
        return this.f8225w;
    }

    public int m12980p() {
        return this.f8214a - this.f8215b;
    }

    public int m12981q() {
        return this.f8219f - this.f8218e;
    }

    public int m12982r() {
        return this.f8221h;
    }

    public String toString() {
        StringBuilder stringBuilder = new StringBuilder();
        stringBuilder.append("ShoesDateSummary: mRunTime = ").append(this.f8220g).append(",mWalkTime = ").append(this.f8221h).append(",mRunCal = ").append(this.f8215b).append(",mCal = ").append(this.f8214a).append(",mRunDis = ").append(this.f8218e).append(",mDis = ").append(this.f8219f).append(",mSteps = ").append(this.f8217d).append(",mForefootRunSteps = ").append(this.f8223u).append(",mVersion = ").append(this.f8222i).append(",mGoal = ").append(this.f8224v);
        return stringBuilder.toString();
    }
}
